bitkeeper revision 1.1159.1.155 (414978fb_upK1Chu4SGdV6AGC6e2jg)
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Thu, 16 Sep 2004 11:28:59 +0000 (11:28 +0000)
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Thu, 16 Sep 2004 11:28:59 +0000 (11:28 +0000)
Cset exclude: cl349@freefall.cl.cam.ac.uk|ChangeSet|20040916093252|64395

linux-2.6.8.1-xen-sparse/drivers/xen/netfront/netfront.c

index 405cd09c28272c1ca63179297f95ce2c605d0687..9501c269781dc6f023d4d1e909df51268b7a2f73 100644 (file)
@@ -393,12 +393,11 @@ static int network_start_xmit(struct sk_buff *skb, struct net_device *dev)
     tx->size = skb->len;
 
     wmb(); /* Ensure that backend will see the request. */
-    i++;
-    np->tx->req_prod = i;
+    np->tx->req_prod = i + 1;
 
     network_tx_buf_gc(dev);
 
-    if ( (i - np->tx_resp_cons) == NETIF_TX_RING_SIZE )
+    if ( (i - np->tx_resp_cons) == (NETIF_TX_RING_SIZE - 1) )
     {
         np->tx_full = 1;
         netif_stop_queue(dev);
@@ -411,7 +410,7 @@ static int network_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
     /* Only notify Xen if there are no outstanding responses. */
     mb();
-    if ( np->tx->resp_prod != i )
+    if ( np->tx->resp_prod == i )
         notify_via_evtchn(np->evtchn);
 
     return 0;